//购物车相关的
import http from '../request';
export function updateCart(id, data) {
  return http({
    method: 'put',
    url: `/api/shop/shoppingCart/${id}`,
    data,
  });
}

// 加入购物车
export function createCart(data) {
  return http({
    method: 'post',
    url: '/api/shop/shoppingCart',
    data,
  });
}
//将来调用的时候
//await updateCart(1,{num:100})
// 获取购物车数据信息
export function getCartInfo(params) {
  return http({
    method: 'get',
    url: '/api/shop/shoppingCart',
    params,
  });
}

//删除购物车单个商品
export function delCartSingle(id) {
  return http({
    method: 'delete',
    url: `/api/shop/shoppingCart/${id}`,
  });
}
